<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <title>${metadata.alias!}</title>
        <@_includePlace path="/8ddab9ba-a8aa-4745-86c6-66bf1c2c976c.html"/> <#-- header -->
    </head>
    <body>
        <@_includePlace path="/c32a4f4a-ff5d-49cf-bb59-5d9784539174.html"/> <#-- 导航 -->

        <div class="banner-l3 position-relative d-flex align-items-center justify-content-center" style="background:#22407c url(${site.sitePath}assets/img/banner-l3-bg-1.png) 50% 50% no-repeat;">
            <div class="container text-center position-relative py-3 py-md-4 text-white">
                <div class="breadcrumbs fs-7 text-white d-inline-flex align-items-center text-opacity-50">
                    <a href="${site.sitePath}">首页</a>
                    &gt; <a href="${site.dynamicPath}votelist.html">投票</a>
                </div>
            </div>
        </div>
        <div class="container">
    <@_voteList pageIndex=pageIndex pageSize=10>
            <ul class="pt-4">
        <#list page.list as a>
                <li>
                    <h3><a href="${site.dynamicPath}vote.html?id=${a.id}">${a.title}</a></h3>
                    <p>${a.description}</p>
                    <#if .now gt a.endDate && a.scores gt 0><#assign show=true/><#else><#assign show=false/></#if>
                    <@_voteItemList voteId=a.id pageSize=3>
                        <ol class="vote">
                            <#list page.list as v>
                            <li>
                                <div class="progress-box">
                                    <div class="progress-bar" style="width:${show?then(v.scores*100/a.scores,100)}%;"></div>
                                    <div class="progress-text">
                                        <a href="${site.dynamicPath}vote.html?id=${a.id}" title="投票后查看">${v.title}<span class="float-end">${show?then(v.scores*100/a.scores+'%','')}</span></a>
                                    </div>
                                </div>
                            </li>
                            </#list>
                        </ol>
                    </@_voteItemList>
                </li>
        </#list>
            </ul>
			<#assign url=site.dynamicPath+'votelist.html'/>
			<ul class="pagination mt-5 overflow-auto pb-3">
				<li class="page-item">
					<a class="page-link" href="${getPage(url,page.prePage,'pageIndex')}" aria-label="Previous">
						<span aria-hidden="true">«</span>
					</a>
				</li>
				<#assign start=1/>
				<#if (page.pageIndex-5) gt start>
				<#assign start=page.pageIndex-4/>
				</#if>
				<#assign end=page.totalPage/>
				<#if (page.pageIndex+5) lt end>
				<#assign end=page.pageIndex+4/>
				</#if>
				<#list start..end as a>
				<li class="page-item<#if a=page.pageIndex> active</#if>"><a class="page-link" href="${getPage(url,a,'pageIndex')}">${a}</a></li>
				</#list>
				<li class="page-item">
					<a class="page-link" href="${getPage(url,page.nextPage,'pageIndex')}" aria-label="Next">
						<span aria-hidden="true">»</span>
					</a>
				</li>
			</ul>
    </@_voteList>
        </div>
        <@_includePlace path="/7f8bacb5-30ca-4641-b66f-987d447b1a85.html"/> <#-- footer -->
    </body>
</html>